<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <h1>hello</h1>
    <script>
      /*
        为了保证能正确获取到节点对象
        1. JS代码放到BODY最后写
        2. 放到window.onload事件中去写
      */
      console.log(document.body); //null
    </script>
  </body>
</html>
